<div class="row-fluid">
    <div class="span12">
        <div class="grid simple">
            <div class="grid-body no-border email-body">
                <?php
                $this->breadcrumbs = array(
                    'Faqs' => array('index'),
                    'Управление',
                );
                ?>
                <?php
                $form = $this->beginWidget('CActiveForm', array(
                    'enableAjaxValidation' => true,
                ));
                ?>
                <br />
                <?php
                $this->widget('bootstrap.widgets.TbGridView', array(
                    'id' => 'faq-grid',
                    'dataProvider' => $model->searchComment(),
                    'filter' => $model,
                    'htmlOptions' => array(
                        'class' => 'table-bordered table-hover',
                    ),
                    'rowCssClassExpression' => '$data->isRead()?"read":"unread"',
                    'columns' => array(
                        array(
                            'id' => 'faqId',
                            'class' => 'CCheckBoxColumn',
                            'selectableRows' => '50',
                        ),
                        array(
                            'name' => 'faqModelId',
                            'value' => '$data->model->pageTitle',
                        //'filter' => '',
                        ),
                        'faqTitle',
                        'faqUserName',
                        array(
                            'name' => 'faqStatus',
                            'header' => 'Статус',
                            'filter' => array('1' => 'Опубликован', '0' => 'Не опубликован'),
                            'value' => '($data->faqStatus=="1")?("Опубликован"):("Не опубликован")'
                        ),
//                        array(
//                            'name' => 'faqView',
//                            'header' => 'View',
//                            'filter' => array('qa' => 'Вопросы и ответы', 'model' => 'Модель'),
//                            'value' => '($data->faqView==1)?("Вопросы и ответы"):("Модель")'
//                        ),
                        array(
                            'class' => 'bootstrap.widgets.TbButtonColumn',
                        ),
                    ),
                ));
                ?>
                <script>
                    function reloadGrid(data) {
                        $.fn.yiiGridView.update('faq-grid');
                    }
                </script>
                <style>
                    table.items tr.unread {
                        background: none repeat scroll 0 0 #FAE6F6 !important; /* red color is unread */
                    }

/*                    table.items tr.read {
                        background: none repeat scroll 0 0 #00FF00 !important;  green color is read 
                    }*/
                </style>
                <br />
                <div>
                    <?php echo CHtml::ajaxSubmitButton('Опубликовать', array('faq/ajaxupdate', 'act' => 'doActive'), array('success' => 'reloadGrid'), array('class' => 'btn btn-success btn-large', 'id' => 'button_left3')); ?>

                    <?php echo CHtml::ajaxSubmitButton('Снять с публикации', array('faq/ajaxupdate', 'act' => 'doInactive'), array('success' => 'reloadGrid'), array('class' => 'btn btn-danger btn-large', 'id' => 'button_left')); ?>

                    <?php echo CHtml::ajaxSubmitButton('Удалить', array('faq/ajaxdelete'), array('success' => 'reloadGrid'), array('class' => 'btn btn-warning btn-large', 'confirm' => 'Точно удалить?')); ?>
                </div>
                <?php $this->endWidget(); ?>
            </div>
        </div>	
    </div>
</div>